package com.student.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * OperationType entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Operation_Type", schema = "dbo", catalog = "StudentManager")
public class OperationType implements java.io.Serializable {

	// Fields

	private Long operationTypeId;
	private String operationTypeName;
	private Set<OperationRecord> operationRecords = new HashSet<OperationRecord>(
			0);

	// Constructors

	/** default constructor */
	public OperationType() {
	}

	/** minimal constructor */
	public OperationType(Long operationTypeId, String operationTypeName) {
		this.operationTypeId = operationTypeId;
		this.operationTypeName = operationTypeName;
	}

	/** full constructor */
	public OperationType(Long operationTypeId, String operationTypeName,
			Set<OperationRecord> operationRecords) {
		this.operationTypeId = operationTypeId;
		this.operationTypeName = operationTypeName;
		this.operationRecords = operationRecords;
	}

	// Property accessors
	@Id
	@Column(name = "Operation_Type_id", unique = true, nullable = false, precision = 18, scale = 0)
	@GeneratedValue
	public Long getOperationTypeId() {
		return this.operationTypeId;
	}

	public void setOperationTypeId(Long operationTypeId) {
		this.operationTypeId = operationTypeId;
	}

	@Column(name = "Operation_Type_Name", nullable = false, length = 50)
	public String getOperationTypeName() {
		return this.operationTypeName;
	}

	public void setOperationTypeName(String operationTypeName) {
		this.operationTypeName = operationTypeName;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "operationType")
	public Set<OperationRecord> getOperationRecords() {
		return this.operationRecords;
	}

	public void setOperationRecords(Set<OperationRecord> operationRecords) {
		this.operationRecords = operationRecords;
	}

}